package com.dq.repository.org;

import com.dq.domain.position.OrgPosition;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author cf
 * 岗位
 *  相当于  dao层   sql接口都是在这里编写
 *
 */
public interface OrgPositionRepository extends JpaRepository<OrgPosition, Long> {

    /**
     * 根据岗位名称获取
     * @param deleted
     * @param postName
     * @return
     */
    List<OrgPosition> findByDeletedAndPostName(Boolean deleted, String postName);

    /**
     * id Jihe
     * @param ids
     * @return
     */
    List<OrgPosition> findByIdIn(List<Long> ids);

    /**
     * 岗位名称
     * @param postName
     * @return
     */
    List<OrgPosition> findByPostNameOrderBySortNoAsc(String postName, Pageable pageable);
    Long countByPostName(String postName);

    List<OrgPosition> findByOrderBySortNoAsc(Pageable pageable);
    Long countByOrderBySortNoAsc();


    List<OrgPosition> findByDeletedFalse();
}
